for %%f in (testdata/*.int) do (
    echo %%f
    diagnostic2.exe <testdata/%%f >testdata/%%~nf.res2
)